<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<script type="text/javascript">
		var str = "13758255527";
		var c = "5"; // 要计算的字符
		var regex = new RegExp(c, 'g'); // 使用g表示整个字符串都要匹配
		var result = str.match(regex);
		var count = !result ? 0 : result.length;
		console.log(c + " 的数量为 " + count);
	</script>
</body>
</html>